#!/usr/bin/env python
# -*- coding:utf-8 -*- #

from popcan.helper.viewhelper import require_login,require_designer
from popcan.biz.accessors import DesignerAccessor
from popcan.helper.requesthelper import respError,JsonResult

@require_login
@require_designer
def getDesignerInfo(request):
    session = request.affix['session']
    custId = session.custId
    designer = DesignerAccessor().getDesigner(custId)
    if not designer:
        return respError('designer_notexists','cant find designer record')
    result = JsonResult()
    result.retdata['designer'] = designer
    return result.response()